<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="plugins/elementui/index.css">
    <script src="plugins/vue/vue.js"></script>
    <script src="plugins/vue/axios-0.18.0.js"></script>
    <script src="plugins/elementui/index.js"></script>
    <script src="js/qrious.min.js"></script>
</head>
<body>
<img id="qrious" style="text-align: center">
<script>
    axios.get("/pay/createNative.do").then((res)=>{
        console.log(res.data);
        var qr = new QRious({
            element:document.getElementById('qrious'),
            size:250,
            level:'H',
            value:res.data.code_url
        });
        queryOrder(res.data.out_trade_no);
    });
    function queryOrder(out_trade_no) {
        axios.get("/pay/queryOrder.do?out_trade_no="+out_trade_no).then((res)=>{
            if(res.data.flag){
                location.href="/success.html"
            }else {
                location.href="/fail.html"
            }
        });
    }
</script>
</body>
</html>